package com.yunxin.core.infra.persistence.converter;

import com.yunxin.core.domain.external.merchant.MerchantAccount;
import com.yunxin.core.domain.external.merchant.MerchantList;
import com.yunxin.core.domain.model.merchant.MerchantContactPerson;
import com.yunxin.core.domain.model.merchant.MerchantInfo;
import com.yunxin.core.domain.model.merchant.MerchantInvoiceInfo;
import com.yunxin.core.domain.model.merchant.MerchantUserAccount;
import com.yunxin.core.infra.persistence.entity.merchant.MerchantContactPersonDO;
import com.yunxin.core.infra.persistence.entity.merchant.MerchantInfoDO;
import com.yunxin.core.infra.persistence.entity.merchant.MerchantInvoiceInfoDO;
import com.yunxin.core.infra.persistence.entity.merchant.MerchantUserAccountDO;
import com.yunxin.core.infra.persistence.entity.merchant.query.result.MerchantAccountResult;
import com.yunxin.core.infra.persistence.entity.merchant.query.result.MerchantListResult;
import org.mapstruct.Mapper;

/**
 * @author zero°
 * @since 2023-07-12
 */
@Mapper(componentModel = "spring")
public interface MerchantConverter {

    /**
     * result 转 entity
     * @param result result
     * @return MerchantAccount
     */
    MerchantAccount toMerchantAccount(MerchantAccountResult result);

    /**
     * result 转 entity
     * @param result result
     * @return MerchantList
     */
    MerchantList toMerchantList(MerchantListResult result);

    /**
     * do 转 entity
     *
     * @param merchantInfoDO merchantInfoDO
     * @return MerchantInfo
     */
    MerchantInfo toMerchantInfo(MerchantInfoDO merchantInfoDO);

    /**
     * do 转 entity
     *
     * @param entity entity
     * @return MerchantUserAccount
     */
    MerchantUserAccount toMerchantUserAccount(MerchantUserAccountDO entity);


    /**
     * entity 转 do
     *
     * @param entity entity
     * @return MerchantContactPersonDO
     */
    MerchantContactPersonDO formMerchantContactPerson(MerchantContactPerson entity);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return MerchantInfoDO
     */
    MerchantInfoDO formMerchantInfo(MerchantInfo entity);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return MerchantInvoiceInfoDO
     */
    MerchantInvoiceInfoDO formMerchantInvoiceInfo(MerchantInvoiceInfo entity);

    /**
     * entity 转 do
     *
     * @param entity entity
     * @return MerchantUserAccountDO
     */
    MerchantUserAccountDO formMerchantUserAccount(MerchantUserAccount entity);

}
